home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1984 July
/
1984-07.d64
/
robot math_64
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
4KB
|
124 lines
10 print"[147]":poke53281,1:poke53280,5:readp1$,p2,p3$,p4:goto710
12 readp1$,p2,p3$,p4:b=54272
15 fori=btob+24:pokei,0:next:vo=b+24:ad=b+5:sr=ad+1:hf=b+1:lf=b:pokead,20
16 pokesr,200:so=b+4:goto130
20 pokeso,32:return
30 pokehf,50:pokelf,40:pokeso,33:form=1toc:next:goto20
40 f=int(rnd(1)*9):return
50 pokeso,33:forl=99to255:pokehf,l:pokelf,50:next:gosub20:goto1050
60 pokeso,33:pokehf,60:pokelf,50:form=1to400:next:goto20
70 printm$;" press return to change":return
80 printm$;" enter digit[146] ":return
90 iff>5thenl=126:iff>9thenl=108:m=1:iff>30thenl=90:m=0:iff>50thenl=108:m=1
100 iff>99thenf=0
110 pokee,l:pokee+1,l:goto430
120 print"":printtab(l);m$;o$;:pokevo,15:gosub30:pokevo,o:printn$:return
130 poke649,1:m$=" [206][163][163][205] [157][157][157][157][157][157] [205][218][218][206] [157][157][157][157][157][157] [187][204][186][172] [157][157][157][157][157][157] [169][171][179][223] [157][157][157][157][157][157] [207][208]"
140 m$=m$+" [157][157][157][157][157][157] [169] [223][146] "
150 n$="[157][157][157][157][157][157] [215][215][215][215] ":o$="[157][157][157][157][157][157] [218][218][218][218] "
160 print"[147] m=menu-----------------------del=erase [146]"
165 poke214,23:print:poke211,15
170 l8=48:poke143,peek(162):goto1050
180 poke651,255:print"":r=54272:s=1561:y=p2:e=1106:rw=16:wr=rw-4:pokevo,15
190 ifp2=3thenrw=17:wr=rw-5
200 ifp1$="-"orp2=1orp2>3theny=2
210 poke214,rw:print:poke211,17:print" "
220 fori=p2to1step-1:a(i)=0:s(i)=0:fork=1toy:gosub30:gosub40
230 a(i)=a(i)+f:s(i)=s(i)-f
240 m=(k*40)+i:poker+s+m,0:pokes+m,f+48:ifk=1thenl1=f
250 next:ifp1$="-"thengosub660:goto270
260 l=a(i):n=9:goto280
270 s(i)=s(i)+2*l1:l=s(i):n=0
280 gosub580:a(i)=l
290 nexti
300 fork=1toy:fori=1top2
310 m=k*40+i:ifpeek(s+m)>48then340
320 ifi=p2thenv=1
330 pokes+m,32:next
340 nextk:ifv=1thenv=0:goto180
350 a=0:u=-1:fori=p2to1step-1:u=u+1:ifp1$="-"thena=a+s(i)*10^u:goto370
360 a=a+a(i)*10^u
370 next
380 a=int(a):l2=0:ifa<0then180
390 fori=2toy:poke214,wr+i:print:poke211,17:print"[144]"p1$:next
400 poke160,0:poke161,0:poke162,0
410 fork=0top2:poke214,rw-1:print:poke211,17+k:print"[195]":next
420 u=len(str$(a))-2:i=0:l1=0:fork=p2top2-ustep-1
430 form=15to17:pokem+e+r+280,0:pokem+e+280,asc(mid$(ti$,m-11))+128:next
440 ifti$="000400"thengosub60:goto550
450 geta$:ifa$=""thenl=124:f=f+1:goto90
460 ifasc(a$)=20thenpoke214,rw:print:poke211,17:print" ":goto420
470 ifa$="m"then710
480 ifa$<"0"ora$>"9"then440
490 print"":l1=int(l1+val(a$)*10^i):i=i+1
500 poke214,rw:print:poke211,17+k:printa$:next
510 ifl1=athengoto50
520 ifl1<>athengosub60
530 l2=l2+1:ifl2>2then550
540 goto410
550 v=0:an$=str$(a):l=len(an$):ifl>p2+1thenv=1
560 ifl-1<p2thenv=l-1-p2
570 poke214,rw:print:poke211,18-v:print"";mid$(an$,2,8):fork=1to3500:next:goto180
580 ifp3$="n"andp1$="+"then610
590 gosub40:x=1:ifl<n+fthen630
600 return
610 ifl>nthenx=-1:goto630
620 return
630 l=0:fork=1toy:m=(k*40)+i:f=peek(s+m)+x:iff<48thenf=48
640 iff>57thenf=57
650 pokes+m,f:l=l+(f-48):next:goto580
660 ifp3$="n"then690
670 ifi=1orf>=l1thenreturn
680 goto700
690 iff<l1thenreturn
700 pokes+m,l1+48:pokes+m-40,f+48:s(i)=(-f)-l1:l1=f:return
710 m$=""
720 print"[147][144]operation (+/-).... ";p1$
730 print"# digits (max=6)...";p2
740 print"carry/borrow....... ";p3$
750 print"# problems (max=9).";p4
760 print" [197][197][197][197][197][197][197][197][197][197][197][197][197][197]
770 [141]70:[153]" (b to begin)";
780 [153]"select:use crsr(up/dn)stop"
790 m[178]1152
800 [139]m1[178]1392[167]m[178]1152
810 [129]i[178]m[164]m[170]20:x[178][194](i):[151]i,x[170]128:[130]
820 [161]a$:[139]a$[178]""[167]820
830 [139][197](a$)[179]10[175][197](a$)[177]0[167]950
840 [139]a$[178]"+"[176]a$[178]"-"[176]a$[178]"y"[176]a$[178]"n"[176][194](197)[178]1[167]a$[178]"1":[137]950
850 [139]a$[178]""[167]900
860 [139]a$[178]"on"[167]940
870 [139]a$[179][177]"b"[167]820
880 [153]"load1040 data";p1$;",";p2;",";p3$;",";p4:[153]"run12";""
890 :[151]198,3:[151]631,13:[151]632,13:[151]633,13:[128]
900 m2[178]m2[171]1:k[178]80
910 m[178]m[170]k:[129]i[178]m[171]k[164]m[171]k[170]20:x[178][194](i):[151]i,x[171]128:[130]:[139]m[177]1392[167]m[178]1152
920 [139]m[179]1152[167]m[178]1392
930 [145](m[171]1064)[173]80[141]70,80,70,80:[137]800
940 m2[178]m2[171]1:k[178][171]80:[137]910
950 [145](m[171]1152)[173]80[137]980,1000,1030:[139]p1$[178]"+"[167]p1$[178]"-":[137]970
960 p1$[178]"+"
970 [151]m[170]20,[198](p1$)[170]128:[137]820
980 [139][197](a$)[177]6[167]a$[178]"6"
990 p2[178][197](a$):[151]m[170]20,p2[170]176:[137]820
1000 [139]p3$[178]"n"[167]p3$[178]"y":[137]1020
1010 p3$[178]"n"
1020 [151]m[170]20,64[170][198](p3$):[137]820
1030 p4[178][197](a$):[151]m[170]20,p4[170]176:[137]820
1040 [131]-, 2 ,n, 2
1050 c[178]0:[153]"stop":[129]l[178]0[164]34:[141]120:[130]
1060 [129]l[178]33[164]0[169][171]1:[141]120:[130]:[153]"":c[178]40
1070 [151]56334,[194](56334)[175]254:[151]1,[194](1)[175]251
1080 l8[178]l8[170]1:[139]l8[171]48[177]p4[167]1120
1090 m[178]53247[170]8[172]l8:[153]"";
1100 [129]m1[178]m[164]m[170]7:x[178][194](m1):[129]l[178]1[164]7:c[178]32:x[178]x[172]2:[139]x[177]255[167]x[178]x[171]256:c[178]209
1110 [153][163]30)"stop"[199](c);:[130]:[153]"cmdcmdcmdcmdcmdcmdcmd";:[130]
1120 [151]1,[194](1)[176]4:[151]56334,[194](56334)[176]1
1130 [139]l8[171]48[177]p4[167]1150
1140 [137]180
1150 [153]"load":[151]214,12:[153]:[151]211,4
1155 [153]"stophow about another game (y/n)?wait"
1160 [161]z$:[139]z$[178]""[176](z$[179][177]"y"[175]z$[179][177]"n")[167]1160
1170 [139]z$[178]"y"[167][140]:[156]:[137]10
1180 [128]